<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<!DOCTYPE document SYSTEM "rml_1_0.dtd">
<document filename="example_5.pdf" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:py="http://genshi.edgewall.org/"
	xmlns:xi="http://www.w3.org/2001/XInclude"> <py:def
	function="pagegraphics()">
	<pageGraphics> <!--
			<stroke color="red"/>
			<lines>10mm 10mm 10mm 290mm</lines>
			<lines>100mm 10mm 100mm 290mm</lines>
			<lines>150mm 10mm 150mm 290mm</lines>
			<lines>200mm 10mm 200mm 290mm</lines>
			--> <stroke color="black" /> <lines>5mm 278mm 205mm 278mm</lines> <lines>3mm
	99mm 4mm 99mm</lines> <lines>206mm 99mm 207mm 99mm</lines> <lines>3mm
	198mm 4mm 198mm</lines> <lines>206mm 198mm 207mm 198mm</lines> <!--<image x="0mm" y="198mm" width="54mm" height="82mm" file="tginvoice/static/rml/gmli-logo.jpg"/>-->
	<!--
			<rect x="5mm" y="245mm" width="100mm" height="45mm"/>
			<rect x="105mm" y="245mm" width="100mm" height="45mm"/>
			--> <!--<image x="5mm" y="275mm" width="95mm" file="tginvoice/static/rml/bar-horz.jpg"/>-->
	<!--<image x="10mm" y="260mm" height="25mm" file="tginvoice/static/rml/bar-vert.jpg"/>-->

	<setFont name="Helvetica" size="28" /> <drawString x="10mm" y="280mm">${invoice.biller.company_name}</drawString>
	<setFont name="Helvetica" size="8" /> <drawString x="10mm" y="274mm">Address:</drawString>
	<drawString x="25mm" y="274mm">${invoice.biller.street}</drawString> <drawString
		x="25mm" y="270mm">${invoice.biller.city}
	${invoice.biller.state_province} ${invoice.biller.post_code}</drawString> <drawString
		x="25mm" y="266mm">${invoice.biller.country}</drawString> <drawString
		x="10mm" y="262mm">Phone:</drawString> <drawString x="25mm" y="262mm">${invoice.biller.phone}</drawString>
	<drawString x="10mm" y="258mm">Mobile:</drawString> <drawString
		x="25mm" y="258mm">${invoice.biller.mobile}</drawString> <drawString
		x="10mm" y="254mm">Email:</drawString> <drawString x="25mm" y="254mm">${invoice.biller.user.email_address}</drawString>
	<drawString x="10mm" y="250mm">VAT Code:</drawString> <drawString
		x="25mm" y="250mm">${invoice.biller.vat_code}</drawString> <!-- invoice summary -->

	<setFont name="Helvetica" size="8" /> <drawString x="150mm" y="286mm">Invoice
	N: </drawString> <drawString x="150mm" y="282mm">Date: </drawString> <drawRightString
		x="185mm" y="286mm">${invoice.number}</drawRightString> <drawRightString
		x="185mm" y="282mm">${invoice.date[0]}/${invoice.date[1]}/${invoice.date[2]}</drawRightString>
	<!-- bill to --> <setFont name="Helvetica-Bold" size="10" /> <drawString
		x="105mm" y="270mm">${invoice.customer.company_name}</drawString> <setFont
		name="Helvetica" size="8" /> <drawString x="105mm" y="266mm">Address:</drawString>
	<drawString x="120mm" y="266mm">${invoice.customer.street}</drawString>
	<drawString x="120mm" y="262mm">${invoice.customer.city}
	${invoice.customer.state_province} ${invoice.customer.post_code}</drawString> <drawString
		x="120mm" y="258mm">${invoice.customer.country}</drawString> <drawString
		x="105mm" y="254mm">VAT Code:</drawString> <drawString x="120mm"
		y="254mm">${invoice.customer.vat_code}</drawString> <lines>5mm
	18mm 205mm 18mm</lines> <drawString x="10mm" y="14mm">${invoice.biller.company_name}</drawString>
	<drawString x="105mm" y="14mm">Page <pageNumber /></drawString> <drawRightString
		x="200mm" y="14mm">VAT Code:
	${invoice.biller.vat_code}</drawRightString> </pageGraphics>
</py:def> <template pageSize="(21cm, 29.7cm)" leftMargin="1.0cm"
	rightMargin="1.0cm" topMargin="1.0cm" bottomMargin="1.0cm"
	title="Mediapole Invoice"
	author="Generated by Tiny ERP, Fabien Pinckaers" allowSplitting="20">
<pageTemplate id="first"> ${pagegraphics()}
<frame id="column" x1="20mm" y1="20mm" width="170mm" height="220mm" />
</pageTemplate> <pageTemplate id="others"> ${pagegraphics()}
<frame id="column" x1="20mm" y1="20mm" width="170mm" height="220mm" />
</pageTemplate> </template> <stylesheet> <blockTableStyle id="accounts">
<blockAlignment value="RIGHT" start="-1,0" stop="-1,-1" /> <lineStyle
	kind="LINEABOVE" start="-1,-2" stop="-1,-2" /> </blockTableStyle> <paraStyle
	name="conditions" fontName="Helvetica" fontSize="8" alignment="justify" />
<paraStyle name="name" fontName="Helvetica-Bold" /> <paraStyle
	name="payment" fontName="Helvetica" fontSize="10" /> <!-- qty,description head -->
<paraStyle name="headc" fontName="Helvetica" fontSize="8.0" leading="10"
	alignment="CENTER" /> <paraStyle name="headr" fontName="Helvetica"
	fontSize="8.0" leading="10" alignment="RIGHT" /> <paraStyle
	name="headl" fontName="Helvetica" fontSize="8.0" leading="10"
	alignment="LEFT" /> <!-- qty --> <paraStyle name="tbodyc"
	fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" />
<paraStyle name="tbodyr" fontName="Helvetica" fontSize="8.0"
	leading="10" alignment="RIGHT" /> <paraStyle name="tbodyl"
	fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" /> <paraStyle
	name="tbodyli" fontName="Helvetica-Oblique" fontSize="7.0" leading="10"
	alignment="LEFT" /> <!--
	<blockTableStyle id="products">
		 <blockFont name="Helvetica-BoldOblique" size="12" start="0,0" stop="-1,0"/>
		 <blockBackground colorName="grey" start="0,0" stop="-1,0"/>
		 <blockTextColor colorName="white" start="0,0" stop="-1,0"/>
		 <blockValign value="TOP"/>
		 <blockAlignment value="RIGHT" start="0,0" stop="-1,-1"/>
		 <blockAlignment value="CENTER" start="1,0" stop="1,0"/>
		 <lineStyle kind="LINEBELOW" colorName="black" start="0,0" stop="-1,0"/>
	</blockTableStyle>
	 --> <blockTableStyle id="products"> <blockAlignment
	value="RIGHT" start="0,0" stop="-1,-1" /> <blockValign value="TOP" /> <lineStyle
	kind="GRID" colorName="black" /> <!--<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,0"/>-->
<blockBackground colorName="#e6e6e6" start="0,0" stop="-1,0" /> </blockTableStyle> <blockTableStyle
	id="summary"> <!--  <blockAlignment value="RIGHT" start="0,0" stop="-1,-1"/>-->
<!-- <blockAlignment value="CENTER" start="-1,0" stop="0,0"/> --> <blockValign
	value="TOP" /> <lineStyle kind="GRID" colorName="black" start="1,0"
	stop="2,-1" /> <!--<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,0"/>-->
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,-1" /> <!-- <blockSpan start="0,0" stop="2,0"/>
			<blockSpan start="-1,0" stop="-1,-1"/>  --> </blockTableStyle> <blockTableStyle
	id="clients"> <!--  <blockAlignment value="RIGHT" start="0,0" stop="-1,-1"/>-->
<!-- <blockAlignment value="CENTER" start="-1,0" stop="0,0"/> --> <blockValign
	value="TOP" /> <lineStyle kind="GRID" colorName="black" start="1,0"
	stop="2,2" /> <!--<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,0"/>-->
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,2" /> <!-- <blockSpan start="0,0" stop="2,0"/>
			<blockSpan start="-1,0" stop="-1,-1"/>  --> </blockTableStyle> - </stylesheet> <story> <!--  <nextFrame/>-->

<setNextTemplate name="others" /> <lines>5mm 270mm 190mm 25mm</lines> <lines>2cm
27.3cm 19cm 27.3cm</lines> <spacer length="5mm" width="1mm" /> <blockTable
	colWidths="30.0,310.0,61.0,41.0,52.0,58.0" style="products">
<tr>
	<td><para style="headc">QTY</para></td>
	<td><para style="headl">Description</para></td>
	<td><para style="headr">Unit Price</para></td>
	<td><para style="headc">VAT</para></td>
	<td><para style="headr">Total</para></td>
	<td><para style="headr">Gross</para></td>
</tr>
<py:for each="product in invoice.products">
	<tr>
		<td><para style="tbodyc">${product['qty']}</para></td>
		<td><para style="tbodyl">${product['description']}</para> <para
			style="tbodyli">{invoice.product._dict[id]['description']}</para></td>
		<td><para style="tbodyr">${product['unit_price']}
		${invoice.currency}</para></td>
		<td><para style="tbodyc">${product['vat']}%</para></td>
		<td><para style="tbodyr">${product['tot_price']}
		${invoice.currency}</para></td>
		<td><para style="tbodyr">${product['gross_price']}
		${invoice.currency}</para></td>
	</tr>
</py:for> <!-- </py:for> --> </blockTable> <spacer length="5mm" width="1mm" /> <!-- <blockTable align="RIGHT" colWidths="120,40" > -->
<blockTable colWidths="400,94,58.0" align="RIGHT" style="summary">

<tr>
	<td></td>
	<td><para style="headr">Total:</para></td>
	<td><para style="tbodyr">${summary['tot']}
	${invoice.currency}</para></td>
</tr>
<tr py:for="key, val in summary['vat'].iteritems()">
	<td></td>
	<td><para style="tbodyr">Total (VAT ${key}%):</para></td>
	<td><para style="tbodyr">${val} ${invoice.currency}</para></td>
</tr>
<tr>
	<td></td>
	<td><para style="tbodyr">Total (Gross):</para></td>
	<td><para style="tbodyr">${summary['gross']}
	${invoice.currency}</para></td>
</tr>
</blockTable> <spacer length="2cm" width="1mm" /> <para style="payment">
Payment of ${summary['gross']} ${invoice.currency} is to be made within
14 days of the invoice being sent: </para> <spacer length="0.5cm" width="1mm" />
<para style="payment"> Account Name: ${invoice.biller.name} </para> <para
	style="payment"> IBAN: ${invoice.biller.iban} </para><para
	style="payment"> Bank: ${invoice.biller.bank} </para> </story> </document>
